home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-04-09 | 13.4 KB | 462 lines | [TEXT/MPS ] |
- ;
- ; File: QD3DGroup.a
- ;
- ; Contains: Q3Group methods
- ;
- ; Version: Technology: Quickdraw 3D 1.5.4
- ; Release: QuickTime 3.0
- ;
- ; Copyright: © 1995-1998 by Apple Computer, Inc., all rights reserved.
- ;
- ; Bugs?: Please include the the file and version information (from above) with
- ; the problem description. Developers belonging to one of the Apple
- ; developer programs can submit bug reports to:
- ;
- ; devsupport@apple.com
- ;
- ;
- IF &TYPE('__QD3DGROUP__') = 'UNDEFINED' THEN
- __QD3DGROUP__ SET 1
-
- IF &TYPE('__QD3D__') = 'UNDEFINED' THEN
- include 'QD3D.a'
- ENDIF
-
- ; ******************************************************************************
- ; ** **
- ; ** Group Typedefs **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; * These flags affect how a group is traversed
- ; * They apply to when a group is "drawn", "picked", "bounded", "written"
- ;
-
-
- ; typedef long TQ3DisplayGroupStateMasks
- kQ3DisplayGroupStateNone EQU 0
- kQ3DisplayGroupStateMaskIsDrawn EQU $01
- kQ3DisplayGroupStateMaskIsInline EQU $02
- kQ3DisplayGroupStateMaskUseBoundingBox EQU $04
- kQ3DisplayGroupStateMaskUseBoundingSphere EQU $08
- kQ3DisplayGroupStateMaskIsPicked EQU $10
- kQ3DisplayGroupStateMaskIsWritten EQU $20
- ; typedef unsigned long TQ3DisplayGroupState
-
- ; ******************************************************************************
- ; ** **
- ; ** Group Routines (apply to all groups) **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3GroupObject Q3Group_New(void )
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_New
- ENDIF
-
- ;
- ; extern TQ3ObjectType Q3Group_GetType(TQ3GroupObject group)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_GetType
- ENDIF
-
- ;
- ; extern TQ3GroupPosition Q3Group_AddObject(TQ3GroupObject group, TQ3Object object)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_AddObject
- ENDIF
-
- ;
- ; extern TQ3GroupPosition Q3Group_AddObjectBefore(TQ3GroupObject group, TQ3GroupPosition position, TQ3Object object)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_AddObjectBefore
- ENDIF
-
- ;
- ; extern TQ3GroupPosition Q3Group_AddObjectAfter(TQ3GroupObject group, TQ3GroupPosition position, TQ3Object object)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_AddObjectAfter
- ENDIF
-
- ;
- ; extern TQ3Status Q3Group_GetPositionObject(TQ3GroupObject group, TQ3GroupPosition position, TQ3Object *object)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_GetPositionObject
- ENDIF
-
- ;
- ; extern TQ3Status Q3Group_SetPositionObject(TQ3GroupObject group, TQ3GroupPosition position, TQ3Object object)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_SetPositionObject
- ENDIF
-
- ;
- ; extern TQ3Object Q3Group_RemovePosition(TQ3GroupObject group, TQ3GroupPosition position)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_RemovePosition
- ENDIF
-
- ;
- ; extern TQ3Status Q3Group_GetFirstPosition(TQ3GroupObject group, TQ3GroupPosition *position)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_GetFirstPosition
- ENDIF
-
- ;
- ; extern TQ3Status Q3Group_GetLastPosition(TQ3GroupObject group, TQ3GroupPosition *position)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_GetLastPosition
- ENDIF
-
- ;
- ; extern TQ3Status Q3Group_GetNextPosition(TQ3GroupObject group, TQ3GroupPosition *position)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_GetNextPosition
- ENDIF
-
- ;
- ; extern TQ3Status Q3Group_GetPreviousPosition(TQ3GroupObject group, TQ3GroupPosition *position)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_GetPreviousPosition
- ENDIF
-
- ;
- ; extern TQ3Status Q3Group_CountObjects(TQ3GroupObject group, unsigned long *nObjects)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_CountObjects
- ENDIF
-
- ;
- ; extern TQ3Status Q3Group_EmptyObjects(TQ3GroupObject group)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_EmptyObjects
- ENDIF
-
- ;
- ; * Typed Access
- ;
-
- ;
- ; extern TQ3Status Q3Group_GetFirstPositionOfType(TQ3GroupObject group, TQ3ObjectType isType, TQ3GroupPosition *position)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_GetFirstPositionOfType
- ENDIF
-
- ;
- ; extern TQ3Status Q3Group_GetLastPositionOfType(TQ3GroupObject group, TQ3ObjectType isType, TQ3GroupPosition *position)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_GetLastPositionOfType
- ENDIF
-
- ;
- ; extern TQ3Status Q3Group_GetNextPositionOfType(TQ3GroupObject group, TQ3ObjectType isType, TQ3GroupPosition *position)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_GetNextPositionOfType
- ENDIF
-
- ;
- ; extern TQ3Status Q3Group_GetPreviousPositionOfType(TQ3GroupObject group, TQ3ObjectType isType, TQ3GroupPosition *position)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_GetPreviousPositionOfType
- ENDIF
-
- ;
- ; extern TQ3Status Q3Group_CountObjectsOfType(TQ3GroupObject group, TQ3ObjectType isType, unsigned long *nObjects)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_CountObjectsOfType
- ENDIF
-
- ;
- ; extern TQ3Status Q3Group_EmptyObjectsOfType(TQ3GroupObject group, TQ3ObjectType isType)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_EmptyObjectsOfType
- ENDIF
-
- ;
- ; * Determine position of objects in a group
- ;
-
- ;
- ; extern TQ3Status Q3Group_GetFirstObjectPosition(TQ3GroupObject group, TQ3Object object, TQ3GroupPosition *position)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_GetFirstObjectPosition
- ENDIF
-
- ;
- ; extern TQ3Status Q3Group_GetLastObjectPosition(TQ3GroupObject group, TQ3Object object, TQ3GroupPosition *position)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_GetLastObjectPosition
- ENDIF
-
- ;
- ; extern TQ3Status Q3Group_GetNextObjectPosition(TQ3GroupObject group, TQ3Object object, TQ3GroupPosition *position)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_GetNextObjectPosition
- ENDIF
-
- ;
- ; extern TQ3Status Q3Group_GetPreviousObjectPosition(TQ3GroupObject group, TQ3Object object, TQ3GroupPosition *position)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Group_GetPreviousObjectPosition
- ENDIF
-
-
- ; ******************************************************************************
- ; ** **
- ; ** Group Subclasses **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3GroupObject Q3LightGroup_New(void )
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3LightGroup_New
- ENDIF
-
- ;
- ; extern TQ3GroupObject Q3InfoGroup_New(void )
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3InfoGroup_New
- ENDIF
-
- ; ******************************************************************************
- ; ** **
- ; ** Display Group Routines **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3GroupObject Q3DisplayGroup_New(void )
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3DisplayGroup_New
- ENDIF
-
- ;
- ; extern TQ3ObjectType Q3DisplayGroup_GetType(TQ3GroupObject group)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3DisplayGroup_GetType
- ENDIF
-
- ;
- ; extern TQ3Status Q3DisplayGroup_GetState(TQ3GroupObject group, TQ3DisplayGroupState *state)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3DisplayGroup_GetState
- ENDIF
-
- ;
- ; extern TQ3Status Q3DisplayGroup_SetState(TQ3GroupObject group, TQ3DisplayGroupState state)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3DisplayGroup_SetState
- ENDIF
-
- ;
- ; extern TQ3Status Q3DisplayGroup_Submit(TQ3GroupObject group, TQ3ViewObject view)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3DisplayGroup_Submit
- ENDIF
-
- ; ******************************************************************************
- ; ** **
- ; ** Ordered Display Group **
- ; ** **
- ; ** Ordered display groups keep objects in order by the type of object: **
- ; ** **
- ; ** 1 kQ3ShapeTypeTransform **
- ; ** 2 kQ3ShapeTypeStyle **
- ; ** 3 kQ3SetTypeAttribute **
- ; ** 4 kQ3ShapeTypeShader **
- ; ** 5 kQ3ShapeTypeCamera **
- ; ** 6 kQ3ShapeTypeLight **
- ; ** 7 kQ3ShapeTypeGeometry **
- ; ** 8 kQ3ShapeTypeGroup **
- ; ** 9 kQ3ShapeTypeUnknown **
- ; ** **
- ; ** Within a type, you are responsible for keeping things in order. **
- ; ** **
- ; ** You may access and/or manipulate the group using the above types **
- ; ** (fast), or you may use any parent or leaf class types (slower). **
- ; ** **
- ; ** Additional types will be added as functionality grows. **
- ; ** **
- ; ** The group calls which access by type are much faster for ordered **
- ; ** display group for the types above. **
- ; ** **
- ; ** N.B. In QuickDraw 3D 1.0 Lights and Cameras are a no-op when drawn. **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3GroupObject Q3OrderedDisplayGroup_New(void )
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3OrderedDisplayGroup_New
- ENDIF
-
- ; ******************************************************************************
- ; ** **
- ; ** IO Proxy Display Group **
- ; ** **
- ; ** IO Proxy display groups are used to place more than one **
- ; ** representation of an object in a metafile. For example, if you know **
- ; ** another program does not understand NURBPatches but does understand **
- ; ** Meshes, you may place a mesh and a NURB Patch in an IO Proxy Group, **
- ; ** and the reading program will select the desired representation. **
- ; ** **
- ; ** Objects in an IO Proxy Display Group are placed in their preferencial**
- ; ** order, with the FIRST object being the MOST preferred, the LAST **
- ; ** object the least preferred. **
- ; ** **
- ; ** The behavior of an IO Proxy Display Group is that when drawn/picked/ **
- ; ** bounded, the first object in the group that is not "Unknown" is used,**
- ; ** and the other objects ignored. **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3GroupObject Q3IOProxyDisplayGroup_New(void )
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3IOProxyDisplayGroup_New
- ENDIF
-
- ; ******************************************************************************
- ; ** **
- ; ** Group Extension Definitions **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; * Searching methods - OPTIONAL
- ;
-
-
- kQ3XMethodType_GroupAcceptObject EQU 'gaco'
-
- kQ3XMethodType_GroupAddObject EQU 'gado'
-
- kQ3XMethodType_GroupAddObjectBefore EQU 'gaob'
-
- kQ3XMethodType_GroupAddObjectAfter EQU 'gaoa'
-
- kQ3XMethodType_GroupSetPositionObject EQU 'gspo'
-
- kQ3XMethodType_GroupRemovePosition EQU 'grmp'
- ;
- ; * Searching methods - OPTIONAL - default uses above methods
- ;
-
-
- kQ3XMethodType_GroupGetFirstPositionOfType EQU 'gfrt'
-
- kQ3XMethodType_GroupGetLastPositionOfType EQU 'glst'
-
- kQ3XMethodType_GroupGetNextPositionOfType EQU 'gnxt'
-
- kQ3XMethodType_GroupGetPrevPositionOfType EQU 'gpvt'
-
- kQ3XMethodType_GroupCountObjectsOfType EQU 'gcnt'
-
- kQ3XMethodType_GroupEmptyObjectsOfType EQU 'geot'
-
- kQ3XMethodType_GroupGetFirstObjectPosition EQU 'gfop'
-
- kQ3XMethodType_GroupGetLastObjectPosition EQU 'glop'
-
- kQ3XMethodType_GroupGetNextObjectPosition EQU 'gnop'
-
- kQ3XMethodType_GroupGetPrevObjectPosition EQU 'gpop'
- ;
- ; * Group Position Methods
- ; *
- ;
-
-
- kQ3XMethodType_GroupPositionSize EQU 'ggpz'
- ; typedef unsigned long TQ3XMethodTypeGroupPositionSize
-
-
- kQ3XMethodType_GroupPositionNew EQU 'ggpn'
-
- kQ3XMethodType_GroupPositionCopy EQU 'ggpc'
-
- kQ3XMethodType_GroupPositionDelete EQU 'ggpd'
- ;
- ; * View Drawing Helpers
- ; *
- ; * TQ3XGroupStartIterateMethod
- ; *
- ; * Pass back *object = NULL to NOT call EndIterate iterate
- ; * Pass back *object != NULL to draw object
- ; * (other side will pass it to EndIterate for deletion!)
- ; *
- ; * *iterator is uninitialized, use for iteration state. Caller should
- ; * ignore it.
- ; *
- ; * TQ3XGroupEndIterateMethod
- ; *
- ; * *object is previous object, dispose it or play with it.
- ; * Pass back NULL when last iteration has occurred
- ; * *iterator is previous value, use for iteration state Caller should
- ; * ignore it.
- ;
-
-
- kQ3XMethodType_GroupStartIterate EQU 'gstd'
-
- kQ3XMethodType_GroupEndIterate EQU 'gitd'
- ;
- ; * IO Helpers
- ; *
- ; * TQ3XGroupEndReadMethod
- ; * Called when a group has been completely read. Group should perform
- ; * validation and clean up any reading caches.
- ;
-
-
- kQ3XMethodType_GroupEndRead EQU 'gerd'
- ;
- ; extern void *Q3XGroup_GetPositionPrivate(TQ3GroupObject group, TQ3GroupPosition position)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3XGroup_GetPositionPrivate
- ENDIF
-
-
-
-
- ENDIF ; __QD3DGROUP__
-
-